/**
 *  \file PublicTrigger.h
 *  \brief Declares an i3 public trigger and the functions to manipulate it.
 */
#ifndef PUBLIC_TRIGGER_H
#define PUBLIC_TRIGGER_H 1

#include <string>

#ifndef _WIN32
	#include <netdb.h>
#endif

#include "OCD_include.h"

#include "I3Key.h"
#include "I3Id.h"
#include "I3Trigger.h"

using namespace std;

/**
  * This class encapsulates a Public Trigger.
  */
class PublicTrigger: public I3Trigger {

   
public:
    /** The DNS (easy to remember name) of the trigger.
      * For eg: mymachine.i3
      */
    string i3DNS;

    /** Space/tab separated list of i3 ids to which this public trigger points. 
     *  If the stack is the empty string, this public trigger points to the IP address.*/
    string stack;
    
    /**
      * This flag indicates if the i3 id of this public trigger was obtained by hashing the name.
      * (i.e. not from the address book)
      */
    bool nameHashedFlag;
    
    PublicTrigger(string i3DNS, string keyStr, string stack, string nameList, I3OverlayNetwork*);

    char* PublicTrigger::toString(char *tmpStr);

};


#endif
